package com.qf.service.Impl;

import com.qf.mapper.CommentMapper;
import com.qf.pojo.NewsComment;
import com.qf.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CommentServiceImpl implements CommentService {
    @Autowired
    CommentMapper commentMapper;
    @Override
    public List<NewsComment> findAll() {
        return commentMapper.selectAll();
    }

    @Override
    public Integer addComment(NewsComment newsComment) {
        newsComment.setCreatedate(new Date());
        return commentMapper.insertSelective(newsComment);
    }
}
